Skip to content

Conversation

RogerSelwyn
Copy link
Contributor

Added docs for query builder based on old query helper docs. Two comments to make:

  1. Should this still be called ExperimentalQuery if it is now the recommended way of creating queries?
  2. Previously you could instantiate a query with a simple mailbox.new_query. Now you must:
from O365.utils import ExperimentalQuery
builder = ExperimentalQuery(protocol=account.protocol) # Which assume you have account available when needed
query = builder.xxxxxx

Would it be feasible to add the new builder method to ApiComponent?

@alejcas
Copy link
Member

alejcas commented Jul 7, 2025

There is not an easy way of introducing a breaking change… It should be experimental and advised for some time before changing the whole api. Otherwise I guess we’re making it difficult for users.

I think we can remove the old query and change the new one so it’s the default soon anyway

@RogerSelwyn
Copy link
Contributor Author

I assume I can just reference QueryBuilder instead of ExperimentalQuery which I imagine won’t get removed in the future?

@alejcas
Copy link
Member

alejcas commented Jul 7, 2025

If you look into the code ExperimentalQuery is just an alias:

https://github.com/O365/python-o365/blob/master/O365/utils/__init__.py#L12

I will remove this alias in the future.

Just use QueryBuilder like you said

@alejcas
Copy link
Member

alejcas commented Sep 5, 2025

@RogerSelwyn thinking of setting the new Query as a default. What do you think?

@RogerSelwyn
Copy link
Contributor Author

It;s fine for me, I already migrated. Just need to note a breaking change in the change log. The challenge will be where people don't have the version of O365 pinned.

Alternatively, include a deprecation warning in the logs for a few months.

@alejcas
Copy link
Member

alejcas commented Sep 5, 2025

It;s fine for me, I already migrated. Just need to note a breaking change in the change log. The challenge will be where people don't have the version of O365 pinned.

Alternatively, include a deprecation warning in the logs for a few months.

The deprecation warning is in place since June 2025 (O365 version 2.1.4)
The new Query object exists since April 2025 (O365 version 2.1.2)

@alejcas
Copy link
Member

alejcas commented Sep 5, 2025

I'll change the default Query to the new one for the moment but keep the old one as well

@alejcas
Copy link
Member

alejcas commented Sep 5, 2025

@RogerSelwyn I've dropped setup.py completely (requirement.txt, etc.) and use the new pyproject.tml with uv:

eff184c

The problem is that I broke the github action to build the pages as it was using ‎requirements-pages.txt and I deleted it.

Do you mind helping me moving the github action to use uv and pyproject.toml?

@RogerSelwyn
Copy link
Contributor Author

OK, so I will have to learn UV, probably time for me to anyway then I can do the same to my own projects. A next week task probably. Then I'm away for a week, 12-19.

@RogerSelwyn
Copy link
Contributor Author

The deprecation warning is in place since June 2025 (O365 version 2.1.4) The new Query object exists since April 2025 (O365 version 2.1.2)

Probably didn't see it because I had migrated...

I'll change the default Query to the new one for the moment but keep the old one as well

Good plan...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants